<template>
  <div>
    <aplid-base-crud ref="crud" class="w-100" v-bind="baseConfig" :paramsObj = "paramsObj">
      <template v-slot:viewItemDialog="{ row, show }">
        <ItemPart 
          @refresh="handleRefresh" 
          @operate="handleOperate" 
          :api="baseConfig.api" 
          :key="show" 
          :nowRowData="row">
        </ItemPart>
      </template>
    </aplid-base-crud>
  </div>
</template>

<script setup lang="ts">
import { nextTick,ref } from 'vue';
import {baseConfig} from './config'
// import TabForm from './components/FormPart/index.vue'
import ItemPart from './components/ItemPart/index.vue'
let crud = ref()
type Props = {
  tableId?:any
}
let props = withDefaults(defineProps<Props>(),{
  tableId:""
})

let paramsObj = {
  tableId:props.tableId
}
//  处理刷新
const handleRefresh = (query) => {
  nextTick(() => {
    crud.value.refreshChange(query)
  })
}
const handleOperate = (type, row, title) => {
  nextTick(() => {
    crud.value.handleOperate(type, row, title)
  })
}
</script>
<style scoped lang="scss">
</style>